It turns out, the gradient of the SDF gives the normal field. So, if you have a collision/SDF field col and position x, y, z, you can get the normal with:
UT_Vector3 n(
col->getValue(x-1,y,z) - col->getValue(x+1,y,z),
col->getValue(x,y-1,z) - col->getValue(x,y+1,z),
col->getValue(x,y,z-1) - col->getValue(x,y,z+1)
);
n.normalize();
Found 4 posts.
Search results Show results as topic list.
Technical Discussion » Get collision normals from collision mask
- Isaac Nygaard
- 4 posts
- Offline
Technical Discussion » Get collision normals from collision mask
- Isaac Nygaard
- 4 posts
- Offline
I am working on collision resolution for a custom solver I am writing. I am using the gas-build-collision-mask node to get the SDF and a velocity field of the collision objects. However, for my collision resolution, I would like to separate the normal and tangential velocity components. What is the best way to do this?
Since my solver is on a grid, I considered just using the gas-enforce-boundary node (since this is pretty much exactly what I am trying to do). However, as far as I know, it will zero out the relative velocity in both normal and tangential directions. I would like to only zero out the relative normal velocity, and optionally, add dynamic friction to the tangential direction.
Any help is much appreciated.
Since my solver is on a grid, I considered just using the gas-enforce-boundary node (since this is pretty much exactly what I am trying to do). However, as far as I know, it will zero out the relative velocity in both normal and tangential directions. I would like to only zero out the relative normal velocity, and optionally, add dynamic friction to the tangential direction.
Any help is much appreciated.
Houdini Indie and Apprentice » "Add" node grouping problem
- Isaac Nygaard
- 4 posts
- Offline
Houdini Indie and Apprentice » "Add" node grouping problem
- Isaac Nygaard
- 4 posts
- Offline
Hey guys, I'm new to the forum. Here's my dilemma:
I have a bunch of points grouped separately (between 2-15 points each). I would like to perform an “Add” operation on each group to convert them to primitives. The add-node has a “By Group” option, but when I select “Each Group Separately”, it doesn't seem to do anything.
Maybe the add-node isn't fit for this. Basically, I'd like to take all the primitive groups and convert them to individual primitives.
I have a bunch of points grouped separately (between 2-15 points each). I would like to perform an “Add” operation on each group to convert them to primitives. The add-node has a “By Group” option, but when I select “Each Group Separately”, it doesn't seem to do anything.
Maybe the add-node isn't fit for this. Basically, I'd like to take all the primitive groups and convert them to individual primitives.
-
- Quick Links